﻿@using TomNet.IMSC.Model.DbModels.FoundHouse;
@{
    Layout = null;
    var entity = ViewBag.entity as FoundHouseRunningsReply;
    var LowPriceHouseID = ViewBag.LowPriceHouseID;
}
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/Css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/Css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/Css/plugins/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="~/Content/Css/animate.css" rel="stylesheet">
    <link href="~/Content/Css/style.css?v=4.1.0" rel="stylesheet">
    <title>Insert</title>
    <link href="/Content/Css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Content/common.css" rel="stylesheet">
</head>
<body>
    <div class="wrapper wrapper-content animated fadeInRight">
        <form class="form-horizontal m-t" id="mainForm">
            <div class="col-sm-12">

                <input type="hidden" id="FoundHouseRunningsID" name="FoundHouseRunningsID" value="@entity.FoundHouseRunningsID" />
                <input type="hidden" id="id" name="id" value="@entity.Id" />



                <div class="form-group">
                    <label class="col-xs-2 control-label">回复信息：</label>
                    <div class="col-xs-10">
                        <input id="Message" name="Message" type="text" class="form-control" value="@entity.Message">
                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请填写回复信息</span>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-2 control-label">低价房ID：</label>
                    <div class="col-xs-10">
                        <input id="LowPriceHouseID" name="LowPriceHouseID" type="text" class="form-control" value="@LowPriceHouseID">
                        <span class="help-block m-b-none"><i class="fa fa-info-circle"></i>请填写低价房ID</span>
                        <i class="fa fa-info-circle">
                            <label style="padding-left: 0px; color:#ED5565;">
                                *低价房ID格式为英文字符，如1,2,3,4
                            </label>
                        </i>
                    </div>
                    </div>
                </div>
                <div>
                    <button id="submit" class="btn btn-primary pull-right" type="submit">
                        <i class="fa fa-check"></i>&nbsp;提&nbsp;交
                    </button>
                </div>
            </div>
        </form>
    </div>


    <!-- 全局js -->
    <script type="text/javascript" src="~/Scripts/jquery.min.js?v=2.1.4"></script>
    <script type="text/javascript" src="~/Scripts/bootstrap.min.js?v=3.3.6"></script>
    <!-- jQuery Validation plugin javascript-->
    <script type="text/javascript" src="~/Scripts/plugins/validate/jquery.validate.min.js"></script>
    <script type="text/javascript" src="~/Scripts/plugins/validate/messages_zh.min.js"></script>
    <script type="text/javascript" src="~/Scripts/Extensions/ExtValidator.js"></script>

    <!-- layer javascript -->
    <script type="text/javascript" src="~/Scripts/plugins/layer/layer.min.js"></script>
    <script src="/Scripts/plugins/iCheck/icheck.min.js"></script>

    <script type="text/javascript">
        $(function () {
            var icon = "<i class='fa fa-times-circle'></i> ";
            var validator = $("#mainForm").validate({
                rules: {
                    Content: { required: true, }
                },
                messages: {
                    Content: { required: icon + "请输入回复信息", }
                },
                submitHandler: function (form) {
                    $.ajax({
                        url: '/FoundHouse/FoundHouse/ReplyEditListAsync',
                        type: "post",
                        dataType: "json",
                        data: $('#mainForm').serialize(),
                        success: function (data) {
                            //Info,Success,Warning,Error
                            var type = data.type;
                            if (type == 1) {
                                layer.msg(data.content, { icon: 6, time: 2000 },
                                    function () {
                                        var index = parent.layer.getFrameIndex(window.name);
                                        parent.layer.close(index);
                                    });

                            } else {
                                layer.msg(data.content, { icon: 5, time: 2000 });
                            }
                        }
                    });
                }
            });
        });
    </script>
</body>
</html>
